package model

import (
	"gorm.io/gorm"
	"time"
)

type Appointment struct {
	Id          uint           `gorm:"column:id;type:bigint UNSIGNED;primaryKey;not null;" json:"id"`
	UserId      uint           `gorm:"column:user_id;type:bigint UNSIGNED;not null;default:0;" json:"user_id"`
	HouseId     uint           `gorm:"column:house_id;type:bigint UNSIGNED;not null;default:0;" json:"house_id"`
	AppointTime time.Time      `gorm:"column:appoint_time;type:datetime(3);comment:预约时间;not null;default:CURRENT_TIMESTAMP(3);" json:"appoint_time"` // 预约时间
	CreatedAt   time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt   time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt   gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (a *Appointment) TableName() string {
	return "appointment"
}
